Returns the hour from a time value that is generated by the TimeSerial or the TimeValue function.
TimeSerial ないし TimeValue 関数による時刻データのシリアル変換値を基に、該当時刻の時を示す数値を返します。
Hour (Number)
Hour (Number)
Integer
整数
Number: Numeric expression that contains the serial time value that is used to return the hour value.
Number: 時刻 (時) 情報を返すために使われる時刻データのシリアル変換値を示す数値表式。
This function is the opposite of the TimeSerial function. It returns an integer value that represents the hour from a time value that is generated by the TimeSerial or the TimeValue function. For example, the expression
この関数は、TimeSerial 関数と逆方向の機能を担っています。この場合の戻り値としては、時刻データを TimeSerial や TimeValue で変換した数値を基に、該当する時刻を示す整数値が返されます。こうした点は、下記のコードを実行してみると分かりやすいでしょう。
Print Hour(TimeSerial(12,30,41))
Print Hour(TimeSerial(12,30,41))
returns the value 12.
この場合の戻り値は 12 となります。
Sub ExampleHour
Sub ExampleHour
Print "The current hour is " & Hour( Now )
Print "現在の時刻は" & Hour( Now )
End Sub
End Sub